package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.GoodsCategoryMapper;
import com.ruoyi.business.domain.GoodsCategory;
import com.ruoyi.business.service.IGoodsCategoryService;

/**
 * 货品类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-20
 */
@Service
public class GoodsCategoryServiceImpl implements IGoodsCategoryService 
{
    @Autowired
    private GoodsCategoryMapper goodsCategoryMapper;

    /**
     * 查询货品类别
     * 
     * @param id 货品类别主键
     * @return 货品类别
     */
    @Override
    public GoodsCategory selectGoodsCategoryById(Long id)
    {
        return goodsCategoryMapper.selectGoodsCategoryById(id);
    }

    /**
     * 查询货品类别列表
     * 
     * @param goodsCategory 货品类别
     * @return 货品类别
     */
    @Override
    public List<GoodsCategory> selectGoodsCategoryList(GoodsCategory goodsCategory)
    {
        return goodsCategoryMapper.selectGoodsCategoryList(goodsCategory);
    }

    /**
     * 新增货品类别
     * 
     * @param goodsCategory 货品类别
     * @return 结果
     */
    @Override
    public int insertGoodsCategory(GoodsCategory goodsCategory)
    {
        goodsCategory.setCreateTime(DateUtils.getNowDate());
        return goodsCategoryMapper.insertGoodsCategory(goodsCategory);
    }

    /**
     * 修改货品类别
     * 
     * @param goodsCategory 货品类别
     * @return 结果
     */
    @Override
    public int updateGoodsCategory(GoodsCategory goodsCategory)
    {
        goodsCategory.setUpdateTime(DateUtils.getNowDate());
        return goodsCategoryMapper.updateGoodsCategory(goodsCategory);
    }

    /**
     * 批量删除货品类别
     * 
     * @param ids 需要删除的货品类别主键
     * @return 结果
     */
    @Override
    public int deleteGoodsCategoryByIds(Long[] ids)
    {
        return goodsCategoryMapper.deleteGoodsCategoryByIds(ids);
    }

    /**
     * 删除货品类别信息
     * 
     * @param id 货品类别主键
     * @return 结果
     */
    @Override
    public int deleteGoodsCategoryById(Long id)
    {
        return goodsCategoryMapper.deleteGoodsCategoryById(id);
    }
}
